home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / quake.zip / HIPGRAPL.ZIP / MISC.QC < prev    next >
Text File  |  1997-01-16  |  18KB  |  746 lines

  1.  
  2. /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4)
  3. Used as a positional target for spotlights, etc.
  4. */
  5. void() info_null =
  6. {
  7.     remove(self);
  8. };
  9.  
  10. /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
  11. Used as a positional target for lightning.
  12. */
  13. void() info_notnull =
  14. {
  15. };
  16.  
  17. //============================================================================
  18.  
  19. float START_OFF = 1;
  20.  
  21. void() light_use =
  22. {
  23.     if (self.spawnflags & START_OFF)
  24.     {
  25.         lightstyle(self.style, "m");
  26.         self.spawnflags = self.spawnflags - START_OFF;
  27.     }
  28.     else
  29.     {
  30.         lightstyle(self.style, "a");
  31.         self.spawnflags = self.spawnflags + START_OFF;
  32.     }
  33. };
  34.  
  35. /*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  36. Non-displayed light.
  37. Default light value is 300
  38. Default style is 0
  39. If targeted, it will toggle between on or off.
  40. */
  41. void() light =
  42. {
  43.     if (!self.targetname)
  44.     {    // inert light
  45.         remove(self);
  46.         return;
  47.     }
  48.  
  49.     if (self.style >= 32)
  50.     {
  51.         self.use = light_use;
  52.         if (self.spawnflags & START_OFF)
  53.             lightstyle(self.style, "a");
  54.         else
  55.             lightstyle(self.style, "m");
  56.     }
  57. };
  58.  
  59. /*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  60. Non-displayed light.
  61. Default light value is 300
  62. Default style is 0
  63. If targeted, it will toggle between on or off.
  64. Makes steady fluorescent humming sound
  65. */
  66. void() light_fluoro =
  67. {
  68.     if (self.style >= 32)
  69.     {
  70.         self.use = light_use;
  71.         if (self.spawnflags & START_OFF)
  72.             lightstyle(self.style, "a");
  73.         else
  74.             lightstyle(self.style, "m");
  75.     }
  76.  
  77.     precache_sound ("ambience/fl_hum1.wav");
  78.     ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
  79. };
  80.  
  81. /*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8)
  82. Non-displayed light.
  83. Default light value is 300
  84. Default style is 10
  85. Makes sparking, broken fluorescent sound
  86. */
  87. void() light_fluorospark =
  88. {
  89.     if (!self.style)
  90.         self.style = 10;
  91.  
  92.     precache_sound ("ambience/buzz1.wav");
  93.     ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC);
  94. };
  95.  
  96. /*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8)
  97. Sphere globe light.
  98. Default light value is 300
  99. Default style is 0
  100. */
  101. void() light_globe =
  102. {
  103.     precache_model ("progs/s_light.spr");
  104.     setmodel (self, "progs/s_light.spr");
  105.     makestatic (self);
  106. };
  107.  
  108. void() FireAmbient =
  109. {
  110.     precache_sound ("ambience/fire1.wav");
  111. // attenuate fast
  112.     ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC);
  113. };
  114.  
  115. /*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
  116. Short wall torch
  117. Default light value is 200
  118. Default style is 0
  119. */
  120. void() light_torch_small_walltorch =
  121. {
  122.     precache_model ("progs/flame.mdl");
  123.     setmodel (self, "progs/flame.mdl");
  124.     FireAmbient ();
  125.     makestatic (self);
  126. };
  127.  
  128. /*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18)
  129. Large yellow flame ball
  130. */
  131. void() light_flame_large_yellow =
  132. {
  133.     precache_model ("progs/flame2.mdl");
  134.     setmodel (self, "progs/flame2.mdl");
  135.     self.frame = 1;
  136.     FireAmbient ();
  137.     makestatic (self);
  138. };
  139.  
  140. /*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  141. Small yellow flame ball
  142. */
  143. void() light_flame_small_yellow =
  144. {
  145.     precache_model ("progs/flame2.mdl");
  146.     setmodel (self, "progs/flame2.mdl");
  147.     FireAmbient ();
  148.     makestatic (self);
  149. };
  150.  
  151. /*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
  152. Small white flame ball
  153. */
  154. void() light_flame_small_white =
  155. {
  156.     precache_model ("progs/flame2.mdl");
  157.     setmodel (self, "progs/flame2.mdl");
  158.     FireAmbient ();
  159.     makestatic (self);
  160. };
  161.  
  162. //============================================================================
  163.  
  164.  
  165. /*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8)
  166. Lava Balls
  167. */
  168.  
  169. void() fire_fly;
  170. void() fire_touch;
  171. void() misc_fireball =
  172. {
  173.  
  174.     precache_model ("progs/lavaball.mdl");
  175.     self.classname = "fireball";
  176.     self.nextthink = time + (random() * 5);
  177.     self.think = fire_fly;
  178.     if (!self.speed)
  179.         self.speed == 1000;
  180. };
  181.  
  182. void() fire_fly =
  183. {
  184. local entity    fireball;
  185.  
  186.     fireball = spawn();
  187.     fireball.solid = SOLID_TRIGGER;
  188.     fireball.movetype = MOVETYPE_TOSS;
  189.     fireball.velocity = '0 0 1000';
  190.     fireball.velocity_x = (random() * 100) - 50;
  191.     fireball.velocity_y = (random() * 100) - 50;
  192.     fireball.velocity_z = self.speed + (random() * 200);
  193.     fireball.classname = "fireball";
  194.     setmodel (fireball, "progs/lavaball.mdl");
  195.     setsize (fireball, '0 0 0', '0 0 0');
  196.     setorigin (fireball, self.origin);
  197.     fireball.nextthink = time + 5;
  198.     fireball.think = SUB_Remove;
  199.     fireball.touch = fire_touch;
  200.  
  201.     self.nextthink = time + (random() * 5) + 3;
  202.     self.think = fire_fly;
  203. };
  204.  
  205.  
  206. void() fire_touch =
  207. {
  208.     T_Damage (other, self, self, 20);
  209.     remove(self);
  210. };
  211.  
  212. //============================================================================
  213.  
  214.  
  215. void() barrel_explode =
  216. {
  217.     self.takedamage = DAMAGE_NO;
  218.     self.classname = "explo_box";
  219.     // did say self.owner
  220.     T_RadiusDamage (self, self, 160, world);
  221.     sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
  222.     particle (self.origin, '0 0 0', 75, 255);
  223.  
  224.     self.origin_z = self.origin_z + 32;
  225.     BecomeExplosion ();
  226. };
  227.  
  228.  
  229.  
  230. /*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64)
  231. TESTING THING
  232. */
  233.  
  234. void() misc_explobox =
  235. {
  236.     local float    oldz;
  237.  
  238.     self.solid = SOLID_BBOX;
  239.     self.movetype = MOVETYPE_NONE;
  240.     precache_model ("maps/b_explob.bsp");
  241.     setmodel (self, "maps/b_explob.bsp");
  242.     precache_sound ("weapons/r_exp3.wav");
  243.     self.health = 20;
  244.     self.th_die = barrel_explode;
  245.     self.takedamage = DAMAGE_AIM;
  246.  
  247.     self.origin_z = self.origin_z + 2;
  248.     oldz = self.origin_z;
  249.     droptofloor();
  250.     if (oldz - self.origin_z > 250)
  251.     {
  252.         dprint ("item fell out of level at ");
  253.         dprint (vtos(self.origin));
  254.         dprint ("\n");
  255.         remove(self);
  256.     }
  257. };
  258.  
  259.  
  260.  
  261.  
  262. /*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64)
  263. Smaller exploding box, REGISTERED ONLY
  264. */
  265.  
  266. void() misc_explobox2 =
  267. {
  268.     local float    oldz;
  269.  
  270.     self.solid = SOLID_BBOX;
  271.     self.movetype = MOVETYPE_NONE;
  272.     precache_model2 ("maps/b_exbox2.bsp");
  273.     setmodel (self, "maps/b_exbox2.bsp");
  274.     precache_sound ("weapons/r_exp3.wav");
  275.     self.health = 20;
  276.     self.th_die = barrel_explode;
  277.     self.takedamage = DAMAGE_AIM;
  278.  
  279.     self.origin_z = self.origin_z + 2;
  280.     oldz = self.origin_z;
  281.     droptofloor();
  282.     if (oldz - self.origin_z > 250)
  283.     {
  284.         dprint ("item fell out of level at ");
  285.         dprint (vtos(self.origin));
  286.         dprint ("\n");
  287.         remove(self);
  288.     }
  289. };
  290.  
  291. //============================================================================
  292.  
  293.  
  294. void(vector org, vector vec) LaunchLaser;
  295.  
  296. //MED 11/09/96 added lava ball and rocket
  297. void() spikeshooter_use =
  298. {
  299.    local entity lavaball;
  300.     if (self.spawnflags & SPAWNFLAG_LASER)
  301.     {
  302.       if (!self.spawnflags & SPAWNFLAG_SILENT)
  303.          sound (self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM);
  304.         LaunchLaser (self.origin, self.movedir);
  305.       newmis.spawnflags = self.spawnflags;
  306.     }
  307.    else if (self.spawnflags & SPAWNFLAG_LAVABALL)
  308.    {
  309.       if (!self.spawnflags & SPAWNFLAG_SILENT)
  310.          sound (self, CHAN_VOICE, "misc/spike.wav", 1, ATTN_NORM);
  311.       lavaball = spawn();
  312.       lavaball.movetype = MOVETYPE_FLYMISSILE;
  313.       lavaball.solid = SOLID_BBOX;
  314.       lavaball.classname = "lavaball";
  315.       // set lavaball speed
  316.       lavaball.velocity = self.movedir * 300;
  317.       lavaball.angles = vectoangles(lavaball.velocity);
  318.       lavaball.owner = self;
  319.       lavaball.touch = T_MissileTouch;
  320.       setmodel (lavaball, "progs/lavarock.mdl");
  321.       setsize (lavaball, '-4 -4 -4', '4 4 4');
  322.       setorigin (lavaball, self.origin);
  323.       lavaball.avelocity = '0 0 400';
  324.       lavaball.nextthink = time + 5;
  325.       lavaball.think = SUB_Remove;
  326.    }
  327.    else if (self.spawnflags & SPAWNFLAG_ROCKET)
  328.    {
  329.       if (!self.spawnflags & SPAWNFLAG_SILENT)
  330.          sound (self, CHAN_VOICE, "weapons/sgun1.wav", 1, ATTN_NORM);
  331.       W_FireRocket();
  332.       newmis.velocity = self.movedir*1000;
  333.       newmis.angles = vectoangles(newmis.velocity);
  334.       setorigin (newmis, self.origin + self.movedir*8);
  335.    }
  336.    else
  337.     {
  338.       if (!self.spawnflags & SPAWNFLAG_SILENT)
  339.          sound (self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM);
  340.         launch_spike (self.origin, self.movedir);
  341.         newmis.velocity = self.movedir * 500;
  342.         if (self.spawnflags & SPAWNFLAG_SUPERSPIKE)
  343.             newmis.touch = superspike_touch;
  344.     }
  345. };
  346.  
  347. //MED 11/01/96 added state capability
  348. void() shooter_think =
  349. {
  350.    if (self.state)
  351.       {
  352.       spikeshooter_use ();
  353.       }
  354.    self.nextthink = time + self.wait;
  355. };
  356.  
  357.  
  358. /*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent
  359. When triggered, fires a spike in the direction set in QuakeEd.
  360. Laser is only for REGISTERED.
  361. */
  362.  
  363. //MED 11/01/96 commented out setmovedir
  364. void() trap_spikeshooter =
  365. {
  366.    SetMovedir ();
  367.     self.use = spikeshooter_use;
  368.     if (self.spawnflags & SPAWNFLAG_LASER)
  369.     {
  370.         precache_model2 ("progs/laser.mdl");
  371.  
  372.         precache_sound2 ("enforcer/enfire.wav");
  373.         precache_sound2 ("enforcer/enfstop.wav");
  374.     }
  375.    else if (self.spawnflags & SPAWNFLAG_LAVABALL)
  376.    {
  377.       precache_model ("progs/lavarock.mdl");
  378. //      self.classname = "fireball";
  379.       precache_sound2 ("misc/spike.wav");
  380.    }
  381.    else if (self.spawnflags & SPAWNFLAG_ROCKET)
  382.    {
  383.       precache_model ("progs/missile.mdl");
  384.       precache_sound ("weapons/sgun1.wav");
  385.    }
  386.    else
  387.         precache_sound ("weapons/spike2.wav");
  388. };
  389.  
  390.  
  391. /*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent
  392. Continuously fires spikes.
  393. "wait" time between spike (1.0 default)
  394. "nextthink" delay before firing first spike, so multiple shooters can be stagered.
  395. */
  396. void() trap_shooter =
  397. {
  398.     trap_spikeshooter ();
  399.  
  400.     if (self.wait == 0)
  401.         self.wait = 1;
  402. //MED 11/01/96 added state capability
  403.    self.state = 1;
  404.     self.nextthink = self.nextthink + self.wait + self.ltime;
  405.     self.think = shooter_think;
  406. };
  407.  
  408. //MED 11/01/96 added new use function
  409. void() trap_shooter_use =
  410.    {
  411.    self.state = 1 - self.state;
  412.    };
  413. //MED 11/01/96 added new function
  414. /*QUAKED trap_switched_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lavaball rocket silent
  415. Continuously fires spikes.
  416. "wait" time between spike (1.0 default)
  417. "nextthink" delay before firing first spike, so multiple shooters can be stagered.
  418. "state" 0 initially off, 1 initially on. (0 default)
  419. */
  420. void() trap_switched_shooter =
  421.    {
  422.    trap_spikeshooter ();
  423.  
  424.     if (self.wait == 0)
  425.         self.wait = 1;
  426. //MED 11/01/96 added state capability
  427.     self.nextthink = self.nextthink + self.wait + self.ltime;
  428.     self.think = shooter_think;
  429.    self.use = trap_shooter_use;
  430.    };
  431.  
  432.  
  433.  
  434. /*
  435. ===============================================================================
  436.  
  437.  
  438. ===============================================================================
  439. */
  440.  
  441.  
  442. void() make_bubbles;
  443. void() bubble_remove;
  444. void() bubble_bob;
  445.  
  446. /*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8)
  447.  
  448. testing air bubbles
  449. */
  450.  
  451. void() air_bubbles =
  452.  
  453. {
  454.     if (deathmatch)
  455.     {
  456.         remove (self);
  457.         return;
  458.     }
  459.     precache_model ("progs/s_bubble.spr");
  460.     self.nextthink = time + 1;
  461.     self.think = make_bubbles;
  462. };
  463.  
  464. void() make_bubbles =
  465. {
  466. local entity    bubble;
  467.  
  468.     bubble = spawn();
  469.     setmodel (bubble, "progs/s_bubble.spr");
  470.     setorigin (bubble, self.origin);
  471.     bubble.movetype = MOVETYPE_NOCLIP;
  472.     bubble.solid = SOLID_NOT;
  473.     bubble.velocity = '0 0 15';
  474.     bubble.nextthink = time + 0.5;
  475.     bubble.think = bubble_bob;
  476.     bubble.touch = bubble_remove;
  477.     bubble.classname = "bubble";
  478.     bubble.frame = 0;
  479.     bubble.cnt = 0;
  480.     setsize (bubble, '-8 -8 -8', '8 8 8');
  481.     self.nextthink = time + random() + 0.5;
  482.     self.think = make_bubbles;
  483. };
  484.  
  485. void() bubble_split =
  486. {
  487. local entity    bubble;
  488.     bubble = spawn();
  489.     setmodel (bubble, "progs/s_bubble.spr");
  490.     setorigin (bubble, self.origin);
  491.     bubble.movetype = MOVETYPE_NOCLIP;
  492.     bubble.solid = SOLID_NOT;
  493.     bubble.velocity = self.velocity;
  494.     bubble.nextthink = time + 0.5;
  495.     bubble.think = bubble_bob;
  496.     bubble.touch = bubble_remove;
  497.     bubble.classname = "bubble";
  498.     bubble.frame = 1;
  499.     bubble.cnt = 10;
  500.     setsize (bubble, '-8 -8 -8', '8 8 8');
  501.     self.frame = 1;
  502.     self.cnt = 10;
  503.     if (self.waterlevel != 3)
  504.         remove (self);
  505. };
  506.  
  507. void() bubble_remove =
  508. {
  509.     if (other.classname == self.classname)
  510.     {
  511. //        dprint ("bump");
  512.         return;
  513.     }
  514.     remove(self);
  515. };
  516.  
  517. void() bubble_bob =
  518. {
  519. local float        rnd1, rnd2, rnd3;
  520. local vector    vtmp1, modi;
  521.  
  522.     self.cnt = self.cnt + 1;
  523.     if (self.cnt == 4)
  524.         bubble_split();
  525.     if (self.cnt == 20)
  526.         remove(self);
  527.  
  528.     rnd1 = self.velocity_x + (-10 + (random() * 20));
  529.     rnd2 = self.velocity_y + (-10 + (random() * 20));
  530.     rnd3 = self.velocity_z + 10 + random() * 10;
  531.  
  532.     if (rnd1 > 10)
  533.         rnd1 = 5;
  534.     if (rnd1 < -10)
  535.         rnd1 = -5;
  536.  
  537.     if (rnd2 > 10)
  538.         rnd2 = 5;
  539.     if (rnd2 < -10)
  540.         rnd2 = -5;
  541.  
  542.     if (rnd3 < 10)
  543.         rnd3 = 15;
  544.     if (rnd3 > 30)
  545.         rnd3 = 25;
  546.  
  547.     self.velocity_x = rnd1;
  548.     self.velocity_y = rnd2;
  549.     self.velocity_z = rnd3;
  550.  
  551.     self.nextthink = time + 0.5;
  552.     self.think = bubble_bob;
  553. };
  554.  
  555. /*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>
  556. ~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/
  557.  
  558. /*QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8)
  559.  
  560. Just for the debugging level.  Don't use
  561. */
  562.  
  563. void() viewthing =
  564.  
  565. {
  566.     self.movetype = MOVETYPE_NONE;
  567.     self.solid = SOLID_NOT;
  568.     precache_model ("progs/player.mdl");
  569.     setmodel (self, "progs/player.mdl");
  570. };
  571.  
  572.  
  573. /*
  574. ==============================================================================
  575.  
  576. SIMPLE BMODELS
  577.  
  578. ==============================================================================
  579. */
  580.  
  581. void() func_wall_use =
  582. {    // change to alternate textures
  583.     self.frame = 1 - self.frame;
  584. };
  585.  
  586. /*QUAKED func_wall (0 .5 .8) ?
  587. This is just a solid wall if not inhibitted
  588. */
  589. void() func_wall =
  590. {
  591.     self.angles = '0 0 0';
  592.     self.movetype = MOVETYPE_PUSH;    // so it doesn't get pushed by anything
  593.     self.solid = SOLID_BSP;
  594.     self.use = func_wall_use;
  595.     setmodel (self, self.model);
  596. };
  597.  
  598.  
  599. /*QUAKED func_illusionary (0 .5 .8) ?
  600. A simple entity that looks solid but lets you walk through it.
  601. */
  602. void() func_illusionary =
  603.  
  604. {
  605.     self.angles = '0 0 0';
  606.     self.movetype = MOVETYPE_NONE;
  607.     self.solid = SOLID_NOT;
  608.     setmodel (self, self.model);
  609.     makestatic ();
  610. };
  611.  
  612. /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4
  613. This bmodel will appear if the episode has allready been completed, so players can't reenter it.
  614. */
  615. void() func_episodegate =
  616.  
  617. {
  618.     if (!(serverflags & self.spawnflags))
  619.         return;            // can still enter episode
  620.  
  621.     self.angles = '0 0 0';
  622.     self.movetype = MOVETYPE_PUSH;    // so it doesn't get pushed by anything
  623.     self.solid = SOLID_BSP;
  624.     self.use = func_wall_use;
  625.     setmodel (self, self.model);
  626. };
  627.  
  628. /*QUAKED func_bossgate (0 .5 .8) ?
  629. This bmodel appears unless players have all of the episode sigils.
  630. */
  631. void() func_bossgate =
  632.  
  633. {
  634.     if ( (serverflags & 15) == 15)
  635.         return;        // all episodes completed
  636.     self.angles = '0 0 0';
  637.     self.movetype = MOVETYPE_PUSH;    // so it doesn't get pushed by anything
  638.     self.solid = SOLID_BSP;
  639.     self.use = func_wall_use;
  640.     setmodel (self, self.model);
  641. };
  642.  
  643. //============================================================================
  644. /*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  645. */
  646. void() ambient_suck_wind =
  647. {
  648.     precache_sound ("ambience/suck1.wav");
  649.     ambientsound (self.origin, "ambience/suck1.wav", 1, ATTN_STATIC);
  650. };
  651.  
  652. /*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  653. */
  654. void() ambient_drone =
  655. {
  656.     precache_sound ("ambience/drone6.wav");
  657.     ambientsound (self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC);
  658. };
  659.  
  660. /*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  661. */
  662. void() ambient_flouro_buzz =
  663. {
  664.     precache_sound ("ambience/buzz1.wav");
  665.     ambientsound (self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC);
  666. };
  667. /*QUAKED ambient_drip (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  668. */
  669. void() ambient_drip =
  670. {
  671.     precache_sound ("ambience/drip1.wav");
  672.     ambientsound (self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC);
  673. };
  674. /*QUAKED ambient_comp_hum (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  675. */
  676. void() ambient_comp_hum =
  677. {
  678.     precache_sound ("ambience/comp1.wav");
  679.     ambientsound (self.origin, "ambience/comp1.wav", 1, ATTN_STATIC);
  680. };
  681. /*QUAKED ambient_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  682. */
  683. void() ambient_thunder =
  684. {
  685.     precache_sound ("ambience/thunder1.wav");
  686.     ambientsound (self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC);
  687. };
  688. /*QUAKED ambient_light_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  689. */
  690. void() ambient_light_buzz =
  691. {
  692.     precache_sound ("ambience/fl_hum1.wav");
  693.     ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
  694. };
  695. /*QUAKED ambient_swamp1 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  696. */
  697. void() ambient_swamp1 =
  698. {
  699.     precache_sound ("ambience/swamp1.wav");
  700.     ambientsound (self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC);
  701. };
  702. /*QUAKED ambient_swamp2 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  703. */
  704. void() ambient_swamp2 =
  705. {
  706.     precache_sound ("ambience/swamp2.wav");
  707.     ambientsound (self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC);
  708. };
  709.  
  710. //============================================================================
  711.  
  712. void() noise_think =
  713. {
  714.     self.nextthink = time + 0.5;
  715.     sound (self, 1, "enforcer/enfire.wav", 1, ATTN_NORM);
  716.     sound (self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM);
  717.     sound (self, 3, "enforcer/sight1.wav", 1, ATTN_NORM);
  718.     sound (self, 4, "enforcer/sight2.wav", 1, ATTN_NORM);
  719.     sound (self, 5, "enforcer/sight3.wav", 1, ATTN_NORM);
  720.     sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM);
  721.     sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM);
  722. };
  723.  
  724. /*QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10)
  725.  
  726. For optimzation testing, starts a lot of sounds.
  727. */
  728.  
  729. void() misc_noisemaker =
  730.  
  731. {
  732.     precache_sound2 ("enforcer/enfire.wav");
  733.     precache_sound2 ("enforcer/enfstop.wav");
  734.     precache_sound2 ("enforcer/sight1.wav");
  735.     precache_sound2 ("enforcer/sight2.wav");
  736.     precache_sound2 ("enforcer/sight3.wav");
  737.     precache_sound2 ("enforcer/sight4.wav");
  738.     precache_sound2 ("enforcer/pain1.wav");
  739.     precache_sound2 ("enforcer/pain2.wav");
  740.     precache_sound2 ("enforcer/death1.wav");
  741.     precache_sound2 ("enforcer/idle1.wav");
  742.  
  743.     self.nextthink = time + 0.1 + random();
  744.     self.think = noise_think;
  745. };
  746.